Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test updates for LLVM18 #4452

Merged
merged 6 commits into from
Mar 8, 2024
Merged

Test updates for LLVM18 #4452

merged 6 commits into from
Mar 8, 2024

Conversation

CaseyCarter
Copy link
Member

@CaseyCarter CaseyCarter commented Mar 5, 2024

A few minimal test updates to respond to Clang changes in LLVM 18.1.0 rc4. No product code changes are needed.

By commit for ease of review:

  • Add -Wno-overriding-option to Clang lines in floating_point_model_matrix: LLVM-D158137 renamed the overriding-t-option warning to overriding-option. To support transitioning, let's try to disable both and tell the compiler to ignore unrecognized warning control options.
  • Fix clang missing-field-initializer warnings: Clang has started diagnosing uses of designated initializers that omit initializers for members without default initializers. This change adds default initializers to types we control and avoids using designated initializers for types we do not. This only affects a couple of tests.
  • Suppress clang warning in GH_000935_complex_numerical_accuracy: Clang warns that "use of NaN is undefined behavior due to the currently enabled floating-point options" in some floating-point contract modes.
  • Don't test equal_to<void> with different enumerations: Clang SFINAES away the return type in C++23. I've disabled this case for all compilers with the expectation that other compilers will eventually behave similarly.

…matrix`

LLVM-D158137 renamed the `overriding-t-option` warning to `overriding-option`. To support transitioning, let's try to disable both and tell the compiler to ignore unrecognized warning options.
Clang 18 has started diagnosing uses of designated initializers that omit initializers for members without default initializers. This change adds default initializers to types we control and avoids using designated initializers for types we do not. This only affects a couple of tests.
Clang warns that "use of NaN is undefined behavior due to the currently enabled floating-point options" in some floating-point contract modes.
Clang 18 SFINAES away the return type in C++23. I've made this compiler-agnostic with the expectation that other compilers will follow suit.
@CaseyCarter CaseyCarter added the test Related to test code label Mar 5, 2024
@CaseyCarter CaseyCarter requested a review from a team as a code owner March 5, 2024 18:05
Comment on lines +247 to +251
#if !_HAS_CXX23
// The return type of equal_to<void>::operator()(T, U) SFINAEs
// when T and U are different enumeration types.
assert(equal_fn(begin(arr3), end(arr3), begin(arr4), end(arr4), equal_to<>{}));
#endif // !_HAS_CXX23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built-in comparison between different enumeration types is removed in C++26 via WG21-P2864R2.

It seems that Clang only applies the removal to C++26 mode (Godbolt link). Why is C++23 mode affected?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly because we're passing /std:c++latest and it's being detected as C++26?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, /std:c++latest is probably mapped to -std=c++2c by Clang 18+ so C++26 core features become available (Godbolt link). 😿 There seems an issue that we can't specify C++23 mode because /std:c++23 is not yet available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really this ought to be // TRANSITION, _HAS_CXX26 but it's not worth resetting testing.

@StephanTLavavej StephanTLavavej self-assigned this Mar 6, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 46f6bc5 into microsoft:main Mar 8, 2024
35 checks passed
@StephanTLavavej
Copy link
Member

Thanks for scouting ahead and fixing this stuff up! 🛠️ 🏞️ 😻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Related to test code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants